<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html class="win-frame">
<head>
 <title>${name_china}管理-查看${name_china}</title>
 <%@include file="/common/head.jsp" %>
 <link href="<%=request.getContextPath()%>/static/plugin/zTree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet">
 <script src="<%=request.getContextPath()%>/static/plugin/zTree/js/jquery.ztree.all-3.5.min.js"></script>
</head>
<body class="iframe-page">
<div class="page-title-wrapper">
    <div class="page-title">
        <div class="page-title-text">
            <span>${name_china}管理</span>
            <span class="split"></span>
            <span>${name_china}详情</span>
        </div>
        <a id="goBack" class="btn-return distance-left" href="javascript:;" onclick="parent.refreshList('${org.code}');"><i class="icon icon-arrow-left"></i>返回上级</a>
    </div>
    <div class="page-title-border"></div>
</div>

<form id="form">
<div class="left-wrap">
     <input type="hidden" id="id" name="id"/>
     <div class="form-cont">
	        <p class="form-cont-title">备注</p>
	        <textarea class="summer-textarea" id="note" name="note"></textarea>
	 </div>
     <div class="form-btn-wrapper" id="funcbar">
        <a class="btn btn-normal" id="backBtn">关闭</a>
    </div>
</div>   
</form>
<script>
var permission = CommonUtil.getPermission('${name_english}');
//请求url
var CONST_URL = {
	NOTE: basePath + "${common_url}note"
};
   $(function(){
	     var data = ${viewEdit};
	   //初始化funcbar
   		$('#funcbar').prepend($.funcbar({
          type: 'button',
          data: permission,
          permit: ['${name_english}:note']
      }));
	   $("#id").val(data.id);
	   $("#note").val(data.note);
	   $('#goBack').on('click', backHome);
	   $('#backBtn').on('click', backHome);
		//保存按钮
      	$('#funcbar').on('click', 'a[data-permit="${name_english}:note"]', submit);
   });
   
 //表单提交
   function submit() {
        $("#form").form({
       	 buttons : ['#saveBtn'],
            ajax: {
                url: CONST_URL.NOTE
            },
            onSubmitSuccess: function (data) {
           	 $.stip({
  	                type:'ok',//显示类型 有info、 ok、 danger
  	                text: '保存成功！',
  	                onBeforeHide: function () {
  	                	backHome();
  	                }
           	 });
             }
        }).form("submit");
   }
   
   function backHome() {
      window.location.href =  basePath + "${common_url}init";
   }
</script>
</body>
</html>